<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <div id="info"></div>
  <div><span>编号：</span><input id="id" type="text"><button id="btn" style="margin-left: 20px;">生成</button><span></span></div>
  <div>结果：</div>
  <div id="res"></div>
</head>
<body>
  <script>
    let btn = document.getElementById('btn')
    let id = document.getElementById('id')
    let res = document.getElementById('res')
    let info = document.getElementById('info')
    let start = 3808, end = 3839
    let length = end - start
    let max = length * (length - 1)
    info.innerHTML = `(注：编号可输入数字0到${max})`
    btn.onclick = function() {
      if (!id.value) {
        alert('请先输入编号')
        return
      } else if (!(id.value >= 0 && id.value <= max)) {
        alert(`编号范围为数字0到${max}`)
        return
      } else {
        let num = parseInt(id.value)
        let nowTime = " 生成时间：" + new Date().getHours() + ":" + new Date().getMinutes() + ":" + new Date().getSeconds()
        let str = String.fromCharCode(start + parseInt(num / length)) + String.fromCharCode(start + (num % length))
        res.innerHTML = str + nowTime
      }
    }
  </script>
</body>
</html>